/**
 *
 */
package cn.dw.mm.controller;

import static org.hamcrest.CoreMatchers.containsString;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.dw.mm.domain.User;
import cn.dw.mm.service.UserService;

/**
 * @author aubrey
 * @date  上午9:29:14
 * 
 */
@Controller
public class LoginController {
	
	@Autowired
	private UserService userService;
	
	
	@RequestMapping("/login")
	@ResponseBody
	public Integer login(User user) {
		int id = userService.login(user);
		if(id > 0) {
//			return "index";
//			page = new ModelAndView("index");
			return id;
		}
//		page = new ModelAndView("testPage");
		return id;
	}
}
